static char SccsId[] = "@(#)spvwave.c	1.7   10/2/95";
/*
 *         Copyright (c) KUBOTA Corporation and HUDSON SOFT,
 *                  1994, 1995 All Rights Reserved
 *
 *  This software comprises unpublished confidential information of
 *  KUBOTA Corp. and HUDSON SOFT. It may not be used, copied or made
 *  available to anyone, except in accordance with the license under
 *  which it is furnished.
 */

#define ASL_USE_MACRO

#include <farl.h>
#include <asl.h>

#if !defined( sindi )
#define sindi(x)        ( (short)FarlGetSin187( (x) ) << 1 )
#endif

void
main()
{
	int		i, j, k;
	ASLSct		sct[64];
	ASLSource	src;

	FX73init();
	FX73_cmap_i5c4();
	FarlInit();
	ASLSetSpriteWindow( 0, 0, 255, 239 );
	src.bank   =  0;
	src.x_size =  1;
	src.y_size = 64;
	for ( i = 0;; i++ ) {
		for ( k = 0; k < 64; k++ ) {
			src.x_pos  = 192 + k;
			src.y_pos  = 128;
			src.x_hot  =   0;
			src.y_hot  =   0;
			ASLMakeSimpleSprite( &src,
				96 + k,
				96 + 8 * sindi( ( ( i + k ) * 110 ) % 3600 )
									/ 256,
				&( sct[k] ) );
		}

		ASLSetSpriteTable( 1, 0, 64, sct );
		ASLExecuteSprite( 1, 0, 64 );

		/*	Swap buffer.	*/
		ASLSync();
		FarlSwapWindow();
		ASLWaitForSwap();
	}
}

